<?php

class HomeController extends Controller
{
	public $layout='column0';

	/**
	 * Declares class-based actions.
	 */
	public function actions()
	{
		/*return array(
			// captcha action renders the CAPTCHA image displayed on the contact page
			'captcha'=>array(
				'class'=>'CCaptchaAction',
				'backColor'=>0xFFFFFF,
			),
			// page action renders "static" pages stored under 'protected/views/site/pages'
			// They can be accessed via: index.php?r=site/page&view=FileName
			'page'=>array(
				'class'=>'CViewAction',
			),
		);*/
	}

	/**
	 * Displays the index page
	 */
	public function actionIndex()
	{
		$this->render('index');
	}

	/**
	 * Displays the about page[关于我们]
	 */
	public function actionAbout()
	{
		$this->render('about');
	}

	/**
	 * Displays the about page[关于我们-屈光手术专科]
	 */
	public function actionAboutClinical()
	{
		$this->render('aboutClinical');
	}

	/**
	 * Displays the about page[关于我们-手术专家]
	 */
	public function actionAboutSpecialist()
	{
		$this->render('aboutSpecialist');
	}


	/**
	 * Displays the surgery page[屈光手术]
	 */
	public function actionSurgery()
	{
		$this->render('surgery');
	}

	/**
	 * Displays the surgery page[屈光手术-屈光不正的矫正]
	 */
	public function actionSurgeryCure()
	{
		$this->render('surgeryCure');
	}

	/**
	 * Displays the surgery page[屈光手术-屈光不正的手术方式]
	 */
	public function actionSurgeryMethod()
	{
		$this->render('surgeryMethod');
	}

	/**
	 * Displays the surgery page[屈光手术-屈光不正的手术方式ICL]
	 */
	public function actionSurgeryMethodIcl()
	{
		$this->render('surgeryMethodIcl');
	}


	/**
	 * Displays the armarium page[顶尖设备]
	 */
	public function actionArmarium()
	{
		$this->render('armarium');
	}

	/**
	 * Displays the armarium page[顶尖设备-阿玛仕]
	 */
	public function actionArmariumAmaris()
	{
		$this->render('armariumAmaris');
	}


	/**
	 * Displays the story page[手术故事]
	 */
	public function actionStory()
	{
		$this->render('story');
	}

	/**
	 * Displays the story page[手术故事-其他手术故事]
	 */
	public function actionStoryCategory()
	{
		$this->render('storyCategory');
	}

	/**
	 * Displays the story page[手术故事-患者真实手术故事]
	 */
	public function actionStoryPatient()
	{
		$this->render('storyPatient');
	}


	/**
	 * Displays the contract page[联系我们]
	 */
	public function actionContract()
	{
		$this->render('contract');
	}


	/**
	 * This is the action to handle external exceptions.
	 */
	public function actionError()
	{
	    if ($error=Yii::app()->errorHandler->error) {
	    	if(Yii::app()->request->isAjaxRequest) {
	    		echo $error['message'];
	    	}
	    	else {
	        	//$this->render('error', $error);
	        	$this->redirect(Yii::app()->homeUrl);
	    	}
	    }
	}

}
